package com.java2_11;
public class Student {
    //标志javaBea + 封装
    //标志javaBea：
    /**
     * （1）成员变量私有化
     * （2）提高getset方法
     * （3）必须有无参构造器
     * */
    private String name;
    private int age;
    private char sex;
    public Student(){

    }

    public Student(String name,int age,char sex){
        this.name = name;
        this.age = age;
        this.sex = sex;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public char getSex() {
        return sex;
    }

    public void setSex(char sex) {
        this.sex = sex;
    }
    public void cop(String name){
        System.out.println(this.name + "正在和" + name + "比赛");
    }
}
